home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / undo / AbstractUndoableEdit.class (.txt) next >
Encoding:
Java Class File  |  1999-07-15  |  1.9 KB  |  81 lines

  1. package javax.swing.undo;
  2.  
  3. import java.io.Serializable;
  4.  
  5. public class AbstractUndoableEdit implements UndoableEdit, Serializable {
  6.    protected static final String UndoName = "Undo";
  7.    protected static final String RedoName = "Redo";
  8.    boolean hasBeenDone = true;
  9.    boolean alive = true;
  10.  
  11.    public boolean addEdit(UndoableEdit var1) {
  12.       return false;
  13.    }
  14.  
  15.    public boolean canRedo() {
  16.       return this.alive && !this.hasBeenDone;
  17.    }
  18.  
  19.    public boolean canUndo() {
  20.       return this.alive && this.hasBeenDone;
  21.    }
  22.  
  23.    public void die() {
  24.       this.alive = false;
  25.    }
  26.  
  27.    public String getPresentationName() {
  28.       return "";
  29.    }
  30.  
  31.    public String getRedoPresentationName() {
  32.       String var1 = this.getPresentationName();
  33.       if (var1 != "") {
  34.          var1 = "Redo " + var1;
  35.       } else {
  36.          var1 = "Redo";
  37.       }
  38.  
  39.       return var1;
  40.    }
  41.  
  42.    public String getUndoPresentationName() {
  43.       String var1 = this.getPresentationName();
  44.       if (var1 != "") {
  45.          var1 = "Undo " + var1;
  46.       } else {
  47.          var1 = "Undo";
  48.       }
  49.  
  50.       return var1;
  51.    }
  52.  
  53.    public boolean isSignificant() {
  54.       return true;
  55.    }
  56.  
  57.    public void redo() throws CannotRedoException {
  58.       if (!this.canRedo()) {
  59.          throw new CannotRedoException();
  60.       } else {
  61.          this.hasBeenDone = true;
  62.       }
  63.    }
  64.  
  65.    public boolean replaceEdit(UndoableEdit var1) {
  66.       return false;
  67.    }
  68.  
  69.    public String toString() {
  70.       return super.toString() + " hasBeenDone: " + this.hasBeenDone + " alive: " + this.alive;
  71.    }
  72.  
  73.    public void undo() throws CannotUndoException {
  74.       if (!this.canUndo()) {
  75.          throw new CannotUndoException();
  76.       } else {
  77.          this.hasBeenDone = false;
  78.       }
  79.    }
  80. }
  81.